<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>我的家 - 果果街</title>
<%@include file="../common/jscss.jsp" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<script type="text/javascript" src="js/home_js/My97DatePicker/WdatePicker.js"></script>
<link href="js/home_js/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.tab li a {
	padding: 6px 20px;
	display: block;
	text-decoration: none;
}
</style>
<script type="text/javascript">
$(function(){
	$("#pager").pager({ pagenumber: ${orderModel.currentPage}, 
		pagecount: ${orderModel.totalPage},
		buttonClickCallback: function(page){
			window.location.href="myOrderProduct.htm?page="+page;
		}
	});
});

function viewMyOrderByDate(){
	var startDate =$("#startDate").val();
	var endDate = $("#endDate").val();
	window.location.href="myOrderProduct.htm?startDate="+startDate+"&endDate="+endDate;
		
	}
	
function cancelOrder(orderId){
	if(p_del()){
		$.post("cancelOrder.htm",{
			orderId:orderId
		},function(data){
			if(data=='success'){
				alert("取消订单成功");
				window.location.href="myOrderProduct.htm"
			}
		});	
	}
}
function p_del() {
	   var msg = "您真的确定要取消订单吗？取消后将不可恢复！！\n\n请确认！";
	   if (confirm(msg)==true){
	    return true;
	   }else{
	    return false;
	   }
}
</script>
<!--[if ie 6]>
	<script src="js/iepng.js" type="text/javascript"></script>
<![endif]-->
</head>
<body>
	<!--/header-->
	<%@include file="../common/header.jsp"%>
	<!--/header-->
	<div class="wraper">

		<div class="content">
			<c:set value="feed" var="meLeftType"></c:set>
			<%@include file="meLeft.jsp"%><!--hleft-->
			<!--huabaoRight-->
			<div class="hbRightWraper">
				<div class="hbBg">
					<img src="imgs/hbPic01.png" class="leftAngle" /><img
						src="imgs/hbPic02.png" class="rightAngle" />
				</div>
				<div class="accWrap">
					<h3 class="colorRed font20px fontWeight">我家的订单</h3>
					<div class="ggbDetail">
						<p class="checkDate">
							起止日期： <input type="text" id="startDate" class="Wdate"
								onclick="WdatePicker({autoPickDate:null,highLineWeekDay:true,dateFmt:'yyyy-MM-dd'});" />&nbsp;-
							<input type="text" id="endDate" class="Wdate"
								onclick="WdatePicker({autoPickDate:null,highLineWeekDay:true,dateFmt:'yyyy-MM-dd'});" />
							<input type="button" class="checkBtn" value="查询" onclick="viewMyOrderByDate();" />
						</p>
						<table width="700" border="0" cellspacing="1" cellpadding="2">
							<tr>
								<td class="tdColorOne">订单单号</td>
								<td class="tdColorTwo">下单日期</td>
								<td class="tdColorOne">商品名称</td>
								<td class="tdColorTwo">订单分类</td>
								<td class="tdColorOne">订单状态</td>
								<td class="tdColorTwo">备注</td>
								<td class="tdColorOne">&nbsp;</td>
							</tr>
							<c:forEach items="${orderModel.list}" var="order">
								<tr>
									<td><span><a href="javascript:void(0)" onclick="">${order.identifier}</a></span></td>
									<td><fmt:formatDate value="${order.gmtCreated}"
											pattern="MM-dd HH:mm" />
									</td>
									<td>${order.productName }</td>
									<td>${order.categoryName}</td>
									<td><c:if test="${empty order.status}">系统出单中....</c:if> 
										<c:if test="${order.status =='01'}">填写地址</c:if> 
										<c:if test="${order.status =='02'}">等待发货</c:if> 
										<c:if test="${order.status =='03'}">已发货</c:if>
										<c:if test="${order.status =='04'}">已完成</c:if>
										<c:if test="${order.status =='05'}">已取消</c:if> 
										<c:if test="${order.status =='06'}">等待点评</c:if> 
										<c:if test="${order.status =='07'}">填写电话</c:if>
										<c:if test="${order.status =='08'}">已预定</c:if> 
										<c:if test="${order.status =='09'}">已参与</c:if> 
										<c:if test="${order.status =='10'}">没参与</c:if>
									</td>
									<td>${order.remark}</td>
									<td>
									   <c:if test="${empty order.status}">
									  		 <a href="javascript:void(0)" onclick="cancelOrder('${order.identifier}');" class="cancelOrder">取消订单</a>
									   </c:if>
									</td>
								</tr>
							</c:forEach>
						</table>
						<span>汇率: 1现金=100果果币</span>
					</div>
					<c:if test="${orderModel.totalPage > 1}">
						<div id="pager" class="h_page" style="margin-top: 20px"></div>
					</c:if>
				</div>
				<div class="hbBg">
					<img src="imgs/hbPic03.png" class="leftAngle" /><img
						src="imgs/hbPic04.png" class="rightAngle" />
				</div>
			</div>
			<!--huabaoRight-->
			<div class="clear"></div>
		</div>
		<!--/content-->
		<%@include file="../common/footer.jsp"%>
		<!--/footer-->
	</div>
	<!--/wraper-->
</body>
</html>
